package com.library.power.service;

import com.library.entity.Power;
import com.library.power.dao.PowerDaoImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(readOnly=false)
public class PowerServiceImpl {
	
	@Resource
	private PowerDaoImpl powerDaoImpl;


	@Transactional(readOnly=true)
	public Power getPower(int powerId){
        return this.powerDaoImpl.getPower(powerId);
	}

	@Transactional(readOnly=true)
	public Power getPowerByType(int type){
		return this.powerDaoImpl.getPowerByType(type);
	}

	@Transactional(readOnly=true)
	/*查找全部图书类别*/
	public List<Power> getAllPowers(){
        return this.powerDaoImpl.getAll();
	}
}
